/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medicalstorebilling;

import database.dao.*;
import database.entity.*;
import java.util.List;
import org.hibernate.criterion.Order;

/**
 *
 * @author Administrator
 */
public class MedicalStoreBilling {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
//        CategoriesDao categoryDao = new CategoriesDao();
//        List<Categories> all = categoryDao.getAll();
//        for (Categories categories : all) {
//            for (Medicines medicine : categories.getMedicines()) {
//                System.out.println(medicine.getName() + " - " + categories.getName());
//            }
//        }
//        CustomersDao customerDao = new CustomersDao();
//        List<Customers> all_customer = customerDao.getAll();
//        for (Customers customers : all_customer) {
//            System.out.println(customers.getName() + " - " + customers.getAddress());
//        }
//        Medicines newMed = new Medicines(0, "thuoc 4", categoryDao.add(new Categories(0, "loai 1", "loai 1")), "thuoc 1", BigDecimal.valueOf(20));
//        Medicines add = new MedicinesDao().add(newMed);
//        List<Medicines> list = new MedicinesDao().search("4",30,all.get(0));
//        for (Medicines medicines : list) {
//            System.out.println(medicines.getCategory().getId()+ " - " + medicines.getName());
//        }
//        System.out.println(add.getName());
//        List<Orders> list = new OrdersDao().search(null, null, "duy", 0);
//        for (Orders orders : list) {
//            System.out.println(orders.getCustomer().getName());
//        }
//        Medicines med = new MedicinesDao().getById(62);
//        System.out.println(med.getStock_not_expired_quantity());
//        StockDetailsDao test = new StockDetailsDao();
//        for (StockDetails stockDetails : test.search("ddavp", 31.0, new CategoriesDao().getById(1), "")) {
//            System.out.println(stockDetails.getMedicine().getName());
//        }
        List<Orders> orders = new OrdersDao().search(null, null, "Eugene", "", -1);
        System.out.println(orders.size());
        List<Distributors> dis = new DistributorsDao().search("", "", "All");
        System.out.println(dis.size());

        for (Distributors distributors : dis) {
            System.out.println(distributors.getPurchases().isEmpty());
        }
    }
}
